let sly = window['sly'] = window['sly'] ? window['sly'] : {}
class SdkEvent {
    constructor() {
        this.loadListener = []
    }
    on(func) {
        let index = this.loadListener.indexOf(func)
        if (index < 0) {
            this.loadListener.push(func)
        }
    }
    off(func) {
        let index = this.loadListener.indexOf(func)
        if (index >= 0) {
            this.loadListener.splice(index, 1)
        }
    }
    emit(data) {
        for (let index = 0; index < this.loadListener.length; index++) {
            const element = this.loadListener[index]
            element(data)
        }
    }
    clear() {
        this.loadListener.length = 0;
    }
}
sly['SdkEvent'] = SdkEvent;


(function (param) {
    console.log('function param ', param)

    var sdk = {}
    var moduleName = sdk;
    if (typeof module !== 'undefined' && typeof exports === 'object') {
        module.exports = moduleName;
        console.log(' module.exports ')
    } else if (typeof define === 'function' && (define.amd || define.cmd)) {
        define(function () { return moduleName; });
        console.log(' define.amd ')
    } else {
        this.moduleName = moduleName;
        console.log(' define.amd ')
    }
}).call(
    function () {
        console.log(' call.amd ')
        return this || (typeof window !== 'undefined' ? window : global);
    });



(function (window) {

    console.log('function window ', window)
}(typeof window !== 'undefined' ? window : global))

